package com.example.controller;


import com.example.commons.beans.UserInfo;
import com.example.commons.util.Dto;
import com.example.commons.util.Page;
import com.example.dao.UserMapper;
import com.example.service.UserService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {
    @Autowired
    private UserService userService;
    @GetMapping("/show")
    public Dto<Page<UserInfo>> show(@RequestParam(value="page",required = false,defaultValue = "1") Integer pageIndex,
                                    @RequestParam(value="size",required = false,defaultValue = "5") Integer pageSize){
        Dto<Page<UserInfo>> dto = userService.getPageUsers(pageIndex, pageSize);
        return dto;
    }

}
